/*
 * @Author: lujiangbo knight_lujb@163.com
 * @Date: 2024-10-18 16:04:12
 * @LastEditors: lujiangbo knight_lujb@163.com
 * @LastEditTime: 2024-10-22 08:20:53
 * @Description: 
 */
import request from "../../utils/request";
import { utils } from "../../utils";
const getDeviceType = (): string => {
  return utils.judgeClient().toLocaleLowerCase();
}
// https://ce-staging.home.qinxi1992.cn:12443/
// 获取manage list数据
export const postToken = (params: any) => {
  return request.get<any, CommonType.ResDataType<any>>(
    `/externalApi/checkUser`,
    { params }
  );
};
// 获取用户信息
export const getUsers = () => {
  return request.get<any, CommonType.ResDataType<any>>(
    `/users`
  );
};

// 获取聊天信息
export const getChatInfo = () => {
  return request.get<any, CommonType.ResDataType<any>>(
    `/redPacketChat/chatRoomInfo`,
    {
      params: {
        platform: getDeviceType()
      }
    }
  );
};

// 获取红包信息
export const getRedPacket = () => {
  return request.get<any, CommonType.ResDataType<any>>(
    `/redPacketChat/rewardRedPacketPre`,
    {
      params: {
        platform: getDeviceType()
      }
    }
  );
};

// 实际领取红包信息
export const postReciveRedPacket = (rewardId: string) => {
  return request.post<any, CommonType.ResDataType<any>>(
    `/redPacketChat/rewardRedPacket`,
    {
      rewardId
    }
  );
};